/*
 *    Copyright (c) 2018-2025, lengleng All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the pig4cloud.com developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: lengleng (wangiegie@gmail.com)
 */

package com.pig4cloud.pigx.user.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

/**
 *
 *
 * @date 2022-08-16 11:00:12
 */
@Data
@TableName("invited_user")
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "")
public class InvitedUser extends Model<InvitedUser> {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value="主键")
	@JsonSerialize(using = ToStringSerializer.class)
    private Long receivedInvitationUuid;

	/**
	 * 受邀请人uid
	 */
	@ApiModelProperty(value="受邀请人uid")
	@JsonSerialize(using = ToStringSerializer.class)
	private Long invitedUid;

    /**
     * 经纪人uid
     */
    @ApiModelProperty(value="经纪人uid")
	@JsonSerialize(using = ToStringSerializer.class)
    private Long agentUid;

    /**
     * 反佣比例
     */
    @ApiModelProperty(value="反佣比例")
    private Integer commissionPercentage;

	/**
	 * 邮箱
	 */
	@ApiModelProperty(value="邮箱")
	private String email;

	/**
	 * 授权公链
	 */
	@ApiModelProperty(value="授权公链")
	private String chain;

	/**
	 * 钱包地址
	 */
	@ApiModelProperty(value="钱包地址")
	private String walletAddress;

	/**
	 * 创建时间
	 */
	@ApiModelProperty(value="创建时间")
	private LocalDateTime createTime;

	/**
	 * 修改时间
	 */
	@ApiModelProperty(value="修改时间")
	private LocalDateTime updateTime;

	/**
	 * 逻辑删除标志
	 */
	@ApiModelProperty(value="逻辑删除标志")
	private String delFlag;

	public InvitedUser(User user) {
		this.invitedUid = user.getUid();
		this.agentUid = user.getInviterId();
		this.email = user.getEmail();
		this.chain = user.getChain();
		this.walletAddress = user.getAddress();
		this.createTime = user.getCreateTime();
		this.updateTime = user.getUpdateTime();
		this.delFlag = user.getDelFlag();
	}
}
